package com.jwm.power.model.entity;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;

import javax.persistence.*;
import java.io.Serializable;

/**
 *  用户表
 * @author tong
 */

@Entity
@Table(name = "users")
@SearchBean(tables = "Users u",orderBy = "deptcode,name asc")
public class Users implements Serializable {
    private static final long serialVersionUID = 1L;

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public String getUsercode() {
        return usercode;
    }

    public void setUsercode(String usercode) {
        this.usercode = usercode;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserpassword() {
        return userpassword;
    }

    public void setUserpassword(String userpassword) {
        this.userpassword = userpassword;
    }

    public String getRolecode() {
        return rolecode;
    }

    public void setRolecode(String rolecode) {
        this.rolecode = rolecode;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }

    public Integer getEditflag() {
        return editflag;
    }

    public void setEditflag(Integer editflag) {
        this.editflag = editflag;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public Integer getCloudedit() {
        return cloudedit;
    }

    public void setCloudedit(Integer cloudedit) {
        this.cloudedit = cloudedit;
    }

    public String getT6usercode() {
        return t6usercode;
    }

    public void setT6usercode(String t6usercode) {
        this.t6usercode = t6usercode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImgurl() {
        return imgurl;
    }

    public void setImgurl(String imgurl) {
        this.imgurl = imgurl;
    }

    public Integer getIsSale() {
        return isSale;
    }

    public void setIsSale(Integer isSale) {
        this.isSale = isSale;
    }

    public String gettDeptcode() {
        return tDeptcode;
    }

    public void settDeptcode(String tDeptcode) {
        this.tDeptcode = tDeptcode;
    }

    public String getCustomerType() {
        return customerType;
    }

    public void setCustomerType(String customerType) {
        this.customerType = customerType;
    }

    public String getCustomerCode() {
        return customerCode;
    }

    public void setCustomerCode(String customerCode) {
        this.customerCode = customerCode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getDeptcode() {
        return deptcode;
    }

    public void setDeptcode(String deptcode) {
        this.deptcode = deptcode;
    }

    public String getJobcode() {
        return jobcode;
    }

    public void setJobcode(String jobcode) {
        this.jobcode = jobcode;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Integer getCloudcodeedit() {
        return cloudcodeedit;
    }

    public void setCloudcodeedit(Integer cloudcodeedit) {
        this.cloudcodeedit = cloudcodeedit;
    }

    public Integer getCloudcodepacking() {
        return cloudcodepacking;
    }

    public void setCloudcodepacking(Integer cloudcodepacking) {
        this.cloudcodepacking = cloudcodepacking;
    }

    public String getJsondatas() {
        return jsondatas;
    }

    public void setJsondatas(String jsondatas) {
        this.jsondatas = jsondatas;
    }

    public String getJobnames() {
        return jobnames;
    }

    public void setJobnames(String jobnames) {
        this.jobnames = jobnames;
    }

    public String getDeptname() {
        return deptname;
    }

    public void setDeptname(String deptname) {
        this.deptname = deptname;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer userid;
    /**  */
    private String usercode ;
    /** 用户名称 */
    private String username ;
    /** 用户密码 */
    private String userpassword ;
    /**  */
    private String rolecode ;
    /**  */
    private String rolename ;
    /**  */
    private Integer editflag ;
    /**  */
    private String tel ;
    /**  */
    private Integer cloudedit ;
    /**  */
    private String t6usercode ;
    /** 姓名 */
    private String name ;
    /** 头像 */
    private String imgurl ;
    /** 是否销售：0否;1是 */
    @Column(name = "is_sale")
    private Integer isSale ;
    /** T6单位编码 */
    private String tDeptcode ;
    /** 客户类型 */
    @Column(name = "Customer_Type")
    private String customerType ;
    /** 客户编码 */
    @Column(name = "Customer_Code")
    private String customerCode ;
    /** 联系电话 */
    private String mobile ;
    /** 部门编码 */
    private String deptcode ;
    /** 部门职务编码 */
    private String jobcode ;
    /**  */
    private String token ;
    /** 码云编码编辑权限 */
    private Integer cloudcodeedit ;
    /** 码云编码装箱权限 */
    private Integer cloudcodepacking ;
    /** 自定义表单数据 */
    private String jsondatas ;

    // 获取职务名称
    @Transient
    @DbField("select jobname from Deptjob j where j.jobcode = u.jobcode")
    private String jobnames;
    // 获取部门名称
    @Transient
    @DbField("select deptname from depts d where d.deptcode = u.deptcode")
    private String deptname;


}
